import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-09-22
 * Time: 22:57
 */
public class Test2 {
    public static void main(String[] args) {
        ExecutorService service = Executors.newFixedThreadPool(4);
        ExecutorService service1 = Executors.newCachedThreadPool();//创建线程动态变化的线程池，
        ExecutorService service2 = Executors.newSingleThreadExecutor();
        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("haha");
            }
        });
        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor();
        ThreadPoolExecutor.AbortPolicy;
        ThreadPoolExecutor.CallerRunsPolicy;
        ThreadPoolExecutor.DiscardOldestPolicy;
        ThreadPoolExecutor.DiscardPolicy;
    }
}
